<template>
  <div class="blog-header">
    <h1 class="blog-title">{{ blog.title }}</h1>
    <div class="blog-meta">
      <span class="blog-date">{{ blog.date }}</span>
      <span class="blog-category">分类：{{ blog.category.name }}</span>
    </div>
  </div>
</template>

<script setup>
import { defineProps } from 'vue'

// 定义组件的属性
const props = defineProps({
  blog: {
    type: Object,
    required: true,
    default: () => ({
      title: '',
      date: '',
      category: ''
    })
  }
})
</script>

<style scoped>
.blog-header {
  background: white;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
  text-align: center;
}

.blog-title {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 16px 0;
  line-height: 1.3;
  letter-spacing: -0.5px;
}

.blog-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 0.95rem;
  color: #999;
}

.blog-date,
.blog-category {
  display: flex;
  align-items: center;
  position: relative;
}

.blog-date::before,
.blog-category::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #ddd;
  margin-right: 8px;
}

@media (max-width: 768px) {
  .blog-title {
    font-size: 1.5rem;
  }
  
  .blog-meta {
    flex-direction: column;
    gap: 8px;
  }
}
</style>